package com.sean.order.service.impl;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.sean.order.service.IOrderService;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements IOrderService {
    @Override
    @SentinelResource(value = "getUser", blockHandler = "blockHandlerForGetUser")    // 使用了 SentinelResource 就不会走统一异常处理
    public String getUser() {
        return "获取用户";
    }

    public String blockHandlerForGetUser(BlockException blockException){
        return "被流控";
    }
}
